﻿using System;
using Natural.Managers;
using Natural.Model;
using Natural.Attributes;
using Natural.Helpers;

namespace Natural.Providers
{  
    public sealed class Invoker
    {
        public static InvokeResponse Invoke(InvokeRequest request)
        {
            InvokeContext context = new InvokeContext() { Request = request, Response = new InvokeResponse() };
            Manager.Invoke(context);
            return context.Response;
        }
        public static void Invoke(InvokeContext context)
        {
            Manager.Invoke(context);
        }

        private static IInvoker Manager
        {
            get { return Solver.Solve("Invoker") as IInvoker; }
        }

    }
}
